home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 020 / speechterm / readme < prev    next >
Text File  |  1995-03-17  |  8KB  |  149 lines

  1. term - a terminal emulator.
  2.  
  3. A few comments
  4. --------------
  5.  
  6. The files term.c gr.c and speech.c  contain  the  sources  for  a
  7. terminal emulator for the amiga.
  8.  
  9. This  terminal  emulator  has  several  features.  This  a   sort
  10. description:
  11.  
  12. 1)  ANSI  protocol.  This  terminal   uses   the   amiga's   ANSI
  13. capabilities  (see  Developer's manual for details). It gives you
  14. 25 lines by 80 columns.  A unix termcap entry can be found in the
  15. file  termcap (in this posting).  It assumes 1200 baud and it has
  16. no problem of keeping up with this rate (it does buffered I/O, in
  17. that  it  doesn't  print  anything,  as  long  as  the host keeps
  18. sending).
  19.  
  20. 2) XMODEM file transfer. You can send a file to a host or get one
  21. from  the host using the XMODEM protocol. It works ok, and I have
  22. seen it recovering from line noise. I have  only  tried  it  with
  23. text files (not with binaries).
  24.  
  25. 3) Graphics. You can get a picture from your host to your  amiga.
  26. You  need of course a program on the host to send the appropriate
  27. sequences. The program understands only 3  commands:  set  color,
  28. draw  line,  and  terminate  :-). There are many more that can be
  29. added (most notably mouse commands). In fact what I use  has  one
  30. more  command:  draw polygon (possibly filled). The reason I have
  31. removed it is  that  the  source  I  used  for  that  belongs  to
  32. Princeton  University.  I guess you can add your own code (I have
  33. left the part of the source that understands the polygon command,
  34. so  all  you need to do is add your own. See function Graphics at
  35. the end of file term.c). The  reason  I  didn't  do  it  yet,  is
  36. because  my  source does some clipping and I don't know how to do
  37. this yet (remember I just got my manuals and they are BIG!  :-)).
  38. The  program  as  it is assumes high resolution - interlaced mode
  39. (640 x 400) pixels.
  40.  
  41. 4) Speech. Well, the speech option is simple: it 'reads out loud'
  42. everything  between  a  control  A  and  the  first non-printable
  43. character. So, to make it read a file, preceed every  line  by  a
  44. control  A.  You  can switch the speech option on and off. What I
  45. really like is to play hack with this!!  It's  fun!  To  do  this
  46. instead  of  the the amiga entry, use the amiga-s entry. Then you
  47. will get to hear things like: you hit the kobolt, or you die!! It
  48. slows  down  the  game  but  its fun, and you can always turn the
  49. speech option off. I have included a file called say.c  that  you
  50. can install on your host and then use it to make your amiga talk.
  51.  
  52. How to use the program
  53. ----------------------
  54.  
  55. To create the executable do a cc term.c gr.c speech.c -o term, or
  56. use  the  makefile supplied. Under Lattice 3.02 everything should
  57. work ok, (but you will of course get the usual warnings!! :-) ).
  58.  
  59. To run the program type term (or whatever you want to call it).
  60.  
  61. The program should start by opening a window,  with  no  borders.
  62. The  borders are there, but by printing the appropriate escapes I
  63. get to use the whole screen for text.  The  prompt  term:  should
  64. appear.  You are in the offline mode. press the help key to get a
  65. listing of all the commands. Type on. You are now in  the  online
  66. mode.  If  everything  is  ok,  you should now be able to talk to
  67. whatever is at the other end of the serial port. To return to the
  68. offline  mode, press the function key 7 (don't ask why 7, I don't
  69. have a logical explanation  :-)).   You  should  get  an  offline
  70. message,  but  note  that this is temporary. You can only execute
  71. one command on the amiga, then  the  program  will  automatically
  72. return  you  to  the  online  mode.  This is useful for executing
  73. commands like sb or rb  that  transfer  files.  To  stay  to  the
  74. offline  mode type off. To exit the program, first get to offline
  75. mode (f7 then type off) and then type end. You should  note  that
  76. you  can  give  any  command from offline. The program 'executes'
  77. them (this of course does not work with cd). There is one bug, in
  78. that  the  program  may crash when you try to go to offline mode,
  79. but this happens very very rarely.
  80.  
  81. To use  the  XMODEM  commands,  get  to  online  mode,  give  the
  82. appropriate  command  to  your  host,  then press f7 and give the
  83. corresponding command to the amiga.  So, if say that you want  to
  84. send something to the host, get to online, type rb filename, then
  85. press f7 and type sb df1:filename or whatever. The program should
  86. then  start transfering your file. At the same time it will print
  87. a count of blocks  transfered.  You  do  need  of  course  XMODEM
  88. commands on your host. There are a couple of bugs. When receiving
  89. a file, the last line contains garbage. You need to edit the file
  90. and remove it. When sending a file, the file contains some nulls.
  91. If your host runs unix, just enter vi and do a w!.
  92.  
  93. The graphics option works like this: to draw  a  picture  on  the
  94. amiga,  first  send  an escape G. This gets you in graphics mode.
  95. Everything that comes after this must be a graphics sequence. The
  96. implemented sequences are: T0 which exits the graphics mode, C %d
  97. %d %d %d\n that sets the color (C pennum r g b, where  pennum the
  98. pen  number,  and  r g b the rgb coefficients), and L %d %d %d %d
  99. %d\n to draw a line (L x1 y1 x2 y2 pennum, where  pennum the  pen
  100. number).   The  parser understands also the command P %d %d %d %d
  101. %d %d %d\n that draws a polygon possibly filled  (P num_of_points
  102. pennum  clip xmin ymin xmax ymax, where clip is a flag of whether
  103. to clip or not and xmin .. are the clip boundaries).  After  this
  104. command  you  must  supply  the  points on the polygon, each on a
  105. separate line (%d %d\n. I didn't  include  the  source  for  this
  106. routine, for the reasons I mentioned before.
  107.  
  108. When the escG is received the program opens a screen (640 x 400),
  109. and  starts  drawing  on  it according to the incomming commands.
  110. When it finishes, the menu strip that wasn't visible  up  to  now
  111. comes  up. To return to the text window, drag this screen down or
  112. send it back. What I chose to do is not to delete the screen when
  113. it  finishes.  Instead  it  stays around until you try to end the
  114. program. This way you can keep your picture for as  long  as  you
  115. want, and maybe print it out using a screen dump program that was
  116. posted some time ago. If you want draw a new picture however, and
  117. since  I forgot to add a clear screen command :-), you must go to
  118. offline mode and type gfxoff which will  delete  the  screen.  If
  119. while  in  graphics mode you want to abort the drawing, press the
  120. menu button on the mouse and then select the quit option from the
  121. menu.  The  menu still works even when not visible. Then get back
  122. to the text screen and do whatever necessary  to  stop  the  host
  123. from  sending  the  graphics  sequences.   Since the program does
  124. handshaking you'll probably need to press control Q first, to get
  125. your  host  to continue. You should make sure that the host sends
  126. the correct sequences, although a character out  of  place  (line
  127. noise) will usually destroy just a small part of the picture. (My
  128. problem is that the graphics packages I use initialize the screen
  129. even  when  I give a command like: foo | amiga, where amiga is my
  130. filter and foo is  a  non-existent  command.  In  this  case  the
  131. program will hung.
  132.  
  133. The sound option is easy. Just preceed everything you want 'read'
  134. by a control A.
  135.  
  136. Acknowledgments
  137. ---------------
  138.  
  139. As I mentioned before, this program uses  parts  (and  bugs  :-))
  140. from a few other programs. The basic program comes from the myCLI
  141. program of Mike Schwartz. I modified  that  to  get  a  25  x  80
  142. screen.  I  then  added  the  XMODEM  transfer routines that were
  143. posted by Michael Mounier, as part of his  terminal  program.   I
  144. used  the  sparks  demo by Scott Ballantyne to get an idea of how
  145. the graphics work. Finally I used Rob Peck's program  speech,  to
  146. add  the  speech option.  Thanks for the help! (If only it hadn't
  147. taken Commodore all these months to give me my manuals! :-( ).
  148.  
  149.